#include "OpenGLContext.h"
#include "glad/glad.h"
#include "Orange/Log.h"

namespace Orange
{
    OpenGLContext::OpenGLContext(GLFWwindow *windowHandle) : m_Window(windowHandle)
    {
    }
    OpenGLContext::~OpenGLContext()
    {
    }
    void OpenGLContext::Init()
    {
        glfwMakeContextCurrent(m_Window);

        if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress))
        {
            ORANGE_CORE_ERROR("Could not intialize GLAD!");
            return;
        }
    };
    void OpenGLContext::Swap()
    {
        glfwSwapBuffers(m_Window);
    };
}